<template>
  <f-ztree :data="data" :defaultCurrentKey="current" showCurrent expandOnCurrent></f-ztree>
  <f-button @click="setCurrent">set current</f-button>
</template>

<script setup lang="ts">
import { ref } from 'vue';
const current = ref(81);
const data = ref([
  { label: '节点-1', key: 1 },
  { label: '节点-2', key: 2 },
  {
    label: '节点-3',
    key: 3,
    children: [
      { label: '节点-4', key: 41 },
      { label: '节点-5', key: 51 },
      { label: '节点-5', key: 61 },
      { label: '节点-5', key: 71, children: [{ label: '节点--12', key: 81 }] }
    ]
  }
]);
function setCurrent() {
  current.value = current.value == 71 ? 61 : 71;
}
</script>
